import re
# s = ["aabce","aaqce", "aape", "a2e", "a!e", "a_e", "aae", "a\e", "ae", "a\re"]
# res1 = re.findall("a.{3}e", str(s))
# print("res1=",res1)
# res2 = re.findall("a.{2,3}e", str(s))
# print("res2=",res2)

s1 = "aeeee"
res3 = re.findall("a.{1,3}e",s1)
print("res3=",res3)

s1 = "aeeee"
# 选择非贪婪匹配
res4 = re.findall("a.{1,3}?e",s1)
print("res4=",res4)

s1 = "aabcce abcde abce ace a2e"



# 重复范围：2到无穷
res5 = re.findall("a.{2,}e",s1)
print("res5=",res5)

s = ["aabce","aaqce", "aape", "a2e", "a!e", "a_e", "aae", "a\e", "ae", "a\re"]
# 只匹配字母，不匹配其他字符
res6 = re.findall('a[a-z]{2,3}e',str(s))
print("res6=",res6)


s = 'abbbc abbc abc'
# 匹配ab{2,3}c
res7 = re.findall('ab{2,3}c',s)
print("res7=",res7)